dose <-  c(20, 30, 40, 45, 60)
drugA <- c(16, 20, 27, 40, 60)
drugB <- c(15, 18, 25, 31, 40)

pdf("./build/druga_vs_drugb.pdf")
  opar <- par(no.readonly=TRUE)
  par(lwd=2, cex=1.5, font.lab=2)
  plot(dose, drugA, type="b",
      pch=15, lty=1, col="red",
      ylim=c(0, 60), main="Drug A vs. Drug B",
      xlan="Drug Dosage",
      ylab="Drug Response")

  lines(dose, drugB, type="b",
      pch=17, lty=2, col="blue")
  #添加参考线，在y=30的位置
  abline(h=c(30), lwd=1.5, lty=2, col="gray")
  library(Hmisc)
  #为x,y轴的刻度添加
  minor.tick(nx=3, ny=3, tick.ratio=0.5)
  legend("topleft", 
        inset.05, 
        title="Drug Type", c("A", "B"),
        lty=c(1, 2), pch=c(15, 17), col=c("red", "blue"))
  par(opar)
dev.off()